<!-- This button is used to display tags in a popover and subscribe to multiple tags using a single button -->
<% buttonStyle ||= 'btn-outline-secondary btn-md' %>
<% buttonColor ||= 'black' %>
<% index ||= 0 %>
<a id="popover_button-<%= index %>" class="btn <%= buttonStyle %>" style="color:<%= buttonColor %>;">Follow
  <i class="fa fa-plus" style="color:<%= buttonColor %>;"></i>
</a>

<div id="mypopcontent-<%= index %>" class="d-none" onmouseleave="show(this)">
  <%= render partial: "tag/tags_popover", locals: {tags: tags} %>
</div>

<script type="text/javascript">
  $('#popover_button-<%= index %>').popover({
    content: $('#mypopcontent-<%= index %>').clone().removeClass('d-none'),
    placement: 'bottom',
    html: true,
  });
  function show(elem){
    $('#popover_button-<%= index %>').popover("hide")
  }
</script>
